﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Threading;
using System.Windows.Interop;

namespace TTIServer.TTISettings.Dialogs
{
	/// <summary>
	/// Interaction logic for PenRotationReport.xaml
	/// </summary>
	public partial class PenRotationReport : Window
	{

		public delegate int ItemDelegete(string Text);
		public delegate void CloseWindowDelgete();
		public delegate void ListBoxViewDelegete(int index);

		public PenRotationReport()
		{
			InitializeComponent();
			PenListBox.Items.Add("Test");
			PenListBox.IsSynchronizedWithCurrentItem = true;
		}

		void SetPenListBoxItem ( int index )
		{

			PenListBox.SelectedIndex = index;

		}

		public void CloseWindow()
		{
			this.Dispatcher.BeginInvoke(new CloseWindowDelgete(this.Close));
		}

		public void AddItem(string newItem)
		{
			int newIndex;
			this.Dispatcher.BeginInvoke(new ItemDelegete(PenListBox.Items.Add), newItem );

		}

	}
}
